<extend name='Index/index' />

<block name="main">
                <div class="bg-light lter b-b wrapper-md">
                    <h1 class="m-n font-thin h3">评论管理</h1>
                </div>
                <div class="wrapper-md">
                    <div class="panel panel-default">
                        <div class="table-responsive">
                            <table class="table table-striped b-t b-light">
                                <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>用户名</th>
                                        <th>评论商品</th>
                                        <th>评论星级</th>
                                        <th>评论内容</th>
                                        <th style="text-align:center;">操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <volist name="appraiseslist" id="vo">
                                        <tr>
                                            <td class="myId"><{$vo.app_id}></td>
                                            <td><{$vo.email}></td>
                                            <td><{$vo.g_name}></td>
                                            <td><{$vo.app_star}>星级</td>
                                            <td><{$vo.app_content}></td>
                                            <td style="text-align:center;"  >
                                                <button class="btn btn-danger">删除</button>
                                            </td> 
                                        </tr>
                                    </volist>
                                </tbody>
                            </table>
                        </div>
                    </div>

                    <p></p>
                    <p></p>
                </div>

                <script>
                    $('.btn-danger').click(function(){
                        $(this).parents('tr').remove();
                        var appid = $(this).parent().prevAll('.myId').html();
                        $.ajax({
                            type: 'post',
                            url: "<{:U('Admin/Appraise/delete')}>",
                            data: "appid="+appid
                        });
                    });
                </script>
</block>